{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "import os\n",
    "\n",
    "ini = \"\"\"\n",
    "[global]\n",
    "index-url = https://pypi.doubanio.com/simple/\n",
    "[install]\n",
    "trusted-host=pypi.doubanio.com\n",
    "\"\"\"\n",
    "pippath = os.environ[\"USERPROFILE\"] + \"\\\\pip\\\\\"\n",
    "if not os.path.exists(pippath):\n",
    "    os.mkdir(pippath)\n",
    "with open(pippath + \"pip.ini\", \"w+\") as f:\n",
    "    f.write(ini)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "#配置成阿里云\n",
    "import os\n",
    "\n",
    "ini = \"\"\"\n",
    "[global]\n",
    "index-url = http://mirrors.aliyun.com/pypi/simple/\n",
    "[install]\n",
    "trusted-host=mirrors.aliyun.com\n",
    "\"\"\"\n",
    "pippath = os.environ[\"USERPROFILE\"] + \"\\\\pip\\\\\"\n",
    "if not os.path.exists(pippath):\n",
    "    os.mkdir(pippath)\n",
    "with open(pippath + \"pip.ini\", \"w+\") as f:\n",
    "    f.write(ini)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "#配置成中国科技大学 \n",
    "import os\n",
    "\n",
    "ini = \"\"\"\n",
    "[global]\n",
    "index-url = https://pypi.mirrors.ustc.edu.cn/simple/ \n",
    "[install]\n",
    "trusted-host=pypi.mirrors.ustc.edu.cn\n",
    "\"\"\"\n",
    "pippath = os.environ[\"USERPROFILE\"] + \"\\\\pip\\\\\"\n",
    "if not os.path.exists(pippath):\n",
    "    os.mkdir(pippath)\n",
    "with open(pippath + \"pip.ini\", \"w+\") as f:\n",
    "    f.write(ini)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "#配置成清华大学\n",
    "import os\n",
    "\n",
    "ini = \"\"\"\n",
    "[global]\n",
    "index-url = https://pypi.tuna.tsinghua.edu.cn/simple/\n",
    "[install]\n",
    "trusted-host=pypi.tuna.tsinghua.edu.cn\n",
    "\"\"\"\n",
    "pippath = os.environ[\"USERPROFILE\"] + \"\\\\pip\\\\\"\n",
    "if not os.path.exists(pippath):\n",
    "    os.mkdir(pippath)\n",
    "with open(pippath + \"pip.ini\", \"w+\") as f:\n",
    "    f.write(ini)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "#配置成中国科技大学\n",
    "import os\n",
    "\n",
    "ini = \"\"\"\n",
    "[global]\n",
    "index-url = http://pypi.mirrors.ustc.edu.cn/simple/\n",
    "[install]\n",
    "trusted-host=pypi.mirrors.ustc.edu.cn\n",
    "\"\"\"\n",
    "pippath = os.environ[\"USERPROFILE\"] + \"\\\\pip\\\\\"\n",
    "if not os.path.exists(pippath):\n",
    "    os.mkdir(pippath)\n",
    "with open(pippath + \"pip.ini\", \"w+\") as f:\n",
    "    f.write(ini)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "#配置成华中理工\n",
    "import os\n",
    "\n",
    "ini = \"\"\"\n",
    "[global]\n",
    "index-url =  http://pypi.hustunique.com/simple/\n",
    "[install]\n",
    "trusted-host=pypi.hustunique.com\n",
    "\"\"\"\n",
    "pippath = os.environ[\"USERPROFILE\"] + \"\\\\pip\\\\\"\n",
    "if not os.path.exists(pippath):\n",
    "    os.mkdir(pippath)\n",
    "with open(pippath + \"pip.ini\", \"w+\") as f:\n",
    "    f.write(ini)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "#配置成山懂理工\n",
    "import os\n",
    "\n",
    "ini = \"\"\"\n",
    "[global]\n",
    "index-url = http://pypi.sdutlinux.org/simple/\n",
    "[install]\n",
    "trusted-host=pypi.sdutlinux.org\n",
    "\"\"\"\n",
    "pippath = os.environ[\"USERPROFILE\"] + \"\\\\pip\\\\\"\n",
    "if not os.path.exists(pippath):\n",
    "    os.mkdir(pippath)\n",
    "with open(pippath + \"pip.ini\", \"w+\") as f:\n",
    "    f.write(ini)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.9"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
